package com.example.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Creat with IntelliJ IDEA
 * Description:
 * User:WZW
 * Date:2022-08-12
 * Time:12:51
 */
@Controller
@ResponseBody
public class UserController {

    // 1.先得到日志对象
    private final static Logger log = LoggerFactory.getLogger(UserController.class);
    @RequestMapping("/sayhi")
    public void sayHi() {
        //2.使用日志对象提供的方法进行日志打印
        log.trace("我是 trace");
        log.debug("我的debug");
        log.info("我的info");
        log.warn("我是warn");
        log.error("我是error");
    }
}
